#!/usr/bin/env bash

case "$(file --dereference --brief --mime-type -- "$1")" in
    image/gif | video/* | audio/*)
        mpv "$1"
        ;;

    image/*)
        swayimg "$1"
        ;;

    *)
        nvim "$1"
        ;;
esac
